﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Flight
{
    class Program
    {
        static void Main(string[] args)
        {
            List<FlightDetailInfo> ListOfFlights = new List<FlightDetailInfo>();
            string DepartureChoise;
            do
            {
                Console.Clear();
                FlightDetailInfo EveryNewFlight = new FlightDetailInfo();
                EveryNewFlight.EnterFlightDetailInfo();
                ListOfFlights.Add(EveryNewFlight);
                Console.WriteLine("Добавить еще рейсы? Д/Н");
                DepartureChoise = Console.ReadLine();
            }
            while (DepartureChoise == "Д" || DepartureChoise == "д");
            Console.WriteLine("В какой город желаете отправиться?");
            string cityToFlight = Console.ReadLine();
            Console.WriteLine("Вам подходят такие варианты:");
            foreach (var ListValue in ListOfFlights)
                if (ListValue.DestinationPoint == cityToFlight)
                {
                    ListValue.ShowFlightDetailInfo();
                }
        }
    }
}
